# Project: arch
# Makefile created by Dev-C++ 5.11

CPP      = g++.exe
CC       = gcc.exe
LD		 = ld.exe
WINDRES  = windres.exe
AS		 = nasm.exe
ASFLAGS	 = -f coff
OBJ      = ./../build/arch/traps.o ./../build/arch/intrhdr.o ./../build/arch/i8259.o ./../build/arch/hw_time.o ./../build/arch/pgd.o ./../build/arch/sys.o ./../build/arch/hw_kb.o
LINKOBJ  = ./../build/arch/traps.o ./../build/arch/intrhdr.o ./../build/arch/i8259.o ./../build/arch/hw_time.o ./../build/arch/pgd.o ./../build/arch/sys.o ./../build/arch/hw_kb.o
LIBS     = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib32" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32" -static-libgcc -m32
INCS     = -I"./../include" -I"./../include/arch"
CXXINCS  = -I"./../include" -I"./../include/arch"
BIN      = ../build/arch/i386-arch.o
CXXFLAGS = $(CXXINCS) -O3 -m32 -pipe
CFLAGS   = $(INCS) -O3 -m32 -pipe
RM       = rm.exe -f

.PHONY: all all-before all-after clean clean-custom

all: all-before $(BIN) all-after

clean: clean-custom
	${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
	$(LD) -r $(LINKOBJ) -o $(BIN)

./../build/arch/traps.o: traps.c
	$(CC) -c traps.c -o ./../build/arch/traps.o $(CFLAGS)

./../build/arch/i8259.o: i8259.c
	$(CC) -c i8259.c -o ./../build/arch/i8259.o $(CFLAGS)

./../build/arch/hw_time.o : hw_time.c
	$(CC) -c hw_time.c -o ./../build/arch/hw_time.o $(CFLAGS)

./../build/arch/pgd.o : pgd.c
	$(CC) -c pgd.c -o ./../build/arch/pgd.o $(CFLAGS)

./../build/arch/sys.o : sys.c
	$(CC) -c sys.c -o ./../build/arch/sys.o $(CFLAGS)
 
./../build/arch/intrhdr.o : intrhdr.asm
	$(AS) $(ASFLAGS) intrhdr.asm -o ./../build/arch/intrhdr.o

./../build/arch/hw_kb.o : hw_kb.c
	$(CC) -c hw_kb.c -o ./../build/arch/hw_kb.o $(CFLAGS)
